#include <bits/stdc++.h>
#define int long long
using namespace std;
inline int read()
{
    int f = 0, ans = 0;
    char c = getchar();
    while (!isdigit(c))
        f |= c == '-', c = getchar();
    while (isdigit(c))
        ans = (ans << 3) + (ans << 1) + c - 48, c = getchar();
    return f ? -ans : ans;
}
void write(int x)
{
    if (x < 0)
        putchar('-'), x = -x;
    if (x > 9)
        write(x / 10);
    putchar(x % 10 + '0');
}
constexpr int N = 2e5 + 5, mod = 1e9 + 7;
int n, k, res;
template <typename T>
inline auto Mod(T &&x) -> auto { return x >= mod ? x -= mod : x; }
inline int qpow(int x, int p)
{
    int ans = 1;
    while (p)
    {
        if (p & 1)
            ans = ans * x % mod;
        x = x * x % mod, p >>= 1;
    }
    return ans;
}
inline int inv(int x) { return qpow(x, mod - 2); }
void dfs(int p, const vector<int> &a)
{
    if (p == k + 1)
    {
        Mod(res += accumulate(begin(a), end(a), 0ll) % mod);
        return;
    }
    int si = static_cast<int>(a.size()) - 1;
    for (int i = 0; i < si; ++i)
    {
        auto b = a;
        b[i] -= b[i + 1];
        b.erase(begin(b) + i + 1);
        dfs(p + 1, b);
    }
}
signed main()
{
    freopen("game.in", "r", stdin);
    freopen("game.out", "w", stdout);
    n = read(), k = read();
    vector<int> a(n);
    for (int i = 0; i < n; ++i)
        a[i] = read();
    dfs(1, a);
    int fac = 1;
    for (int i = n - k; i < n; ++i)
        fac = fac * i % mod;
    write(res * inv(fac) % mod), putchar('\n');
    return 0;
}